#include <algorithm>
#include <cstdio>

const int N = 101;
int n, t, x, y;
int ans[N][N] = {
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 4862, 4862, 3432, 2002, 1001, 429, 154, 44, 9, 1},
    {0, 4862, 1430, 2860, 3003, 2288, 1375, 660, 245, 64, 9},
    {0, 3432, 2860, 858, 2145, 2673, 2310, 1500, 729, 245, 44},
    {0, 2002, 3003, 2145, 660, 1848, 2520, 2304, 1500, 660, 154},
    {0, 1001, 2288, 2673, 1848, 588, 1764, 2520, 2310, 1375, 429},
    {0, 429, 1375, 2310, 2520, 1764, 588, 1848, 2673, 2288, 1001},
    {0, 154, 660, 1500, 2304, 2520, 1848, 660, 2145, 3003, 2002},
    {0, 44, 245, 729, 1500, 2310, 2673, 2145, 858, 2860, 3432},
    {0, 9, 64, 245, 660, 1375, 2288, 3003, 2860, 1430, 4862},
    {0, 1, 9, 44, 154, 429, 1001, 2002, 3432, 4862, 4862},
};

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#endif
#ifndef LOCAL
  freopen("tg.in", "r", stdin);
  freopen("tg.out", "w", stdout);
#endif
#endif

  scanf("%d", &t);
  while (t--) {
    scanf("%d%d%d", &n, &x, &y);
    printf("%d\n", ans[x][y]);
  }
  return 0;
}